package server;

import javax.swing.*;

public class ServerFrame extends JFrame {
	private ServerController controller;
	private JTextArea area = new JTextArea(10, 50);

	public ServerFrame(ServerController controller) {
		super("Friendbook server");
		this.controller = controller;

		area.setEditable(false);
		add(new JScrollPane(area));
		pack();
		setLocationRelativeTo(null);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}

	public void println(String text) {
		area.append(text + "\n");
		area.setCaretPosition(area.getText().length());
	}
}